package org.opens.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * @Date 2021/2/10 17:59
 * @Created by 99126
 */
@Configuration
@EnableTransactionManagement
public class MybatisConfig {

    /*
     * 使用这个来做总事务 后面的数据源就不用设置事务了
     * */
    //@Bean(name = "transactionManager")
    //@Primary
    /*public JtaTransactionManager regTransactionManager () {
        UserTransactionManager userTransactionManager = new UserTransactionManager();
        UserTransaction userTransaction = new UserTransactionImp();
        JtaTransactionManager jtaTransactionManager = new JtaTransactionManager(userTransaction, userTransactionManager);
        jtaTransactionManager.setAllowCustomIsolationLevels(true);
        return jtaTransactionManager;
    }*/

}
